package com.tensquare.sms.listener;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = {"q1"})   //声明从哪些队列里接收消息
public class Q1Listener {

    //接收消息的处理方法
    @RabbitHandler
    public void reciveMsg(String msg) { //这里参数类型,发送的什么类型,就用什么类型接收,例如发送的是User类型,就用User user参数接收
        System.out.println("从Q1队列获取信息为::"+msg);
    }
}
